package com.xhm.bbs.web.api;

import com.xhm.bbs.pojo.dto.BbsAddDTO;
import com.xhm.bbs.pojo.dto.BbsUpdateDTO;
import com.xhm.bbs.pojo.qo.BbsQO;
import com.xhm.bbs.pojo.vo.BbsListVO;
import com.xhm.bbs.pojo.vo.BbsShowVO;
import com.xhm.common.pojo.qo.OptionQO;
import com.xhm.common.pojo.vo.OptionVO;
import com.xhm.common.pojo.vo.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;

import java.util.List;

/**
 * 【帖子】API
 * <p>swagger接口文档
 *
 * @author mrj
 * @date 2020/01/01
 */
@Api(tags = "【帖子】API")
public interface BbsAPI {

    /**
     * 新增【帖子】
     */
    @ApiOperation(value="新增【帖子】")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "bbsAddDTO", dataType = "BbsAddDTO", value = "新增【帖子】参数", paramType = "body"),
    })
    ResponseEntity<BbsShowVO> save(BbsAddDTO bbsAddDTO) throws Exception;

    /**
     * 修改【帖子】
     */
    @ApiOperation(value="修改【帖子】")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "bbsUpdateDTO", dataType = "BbsUpdateDTO", value = "修改【帖子】参数", paramType = "body"),
    })
    ResponseEntity<BbsShowVO> update(BbsUpdateDTO bbsUpdateDTO);

    /**
     * 分页查询【帖子】
     */
    @ApiOperation(value="分页查询【帖子】")
    ResponseEntity<PageVO<BbsListVO>> list(BbsQO bbsQO);

    /**
     * 查询【帖子】选项列表
     */
    @ApiOperation(value = "查询【帖子】选项列表")
    ResponseEntity<List<OptionVO<Long, String>>> findOptions(OptionQO<Long, String> qo);

    /**
     * 查看【帖子】详情
     */
    @ApiOperation(value="查看【帖子】详情")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", dataType = "Long", value = "【帖子】id", paramType = "path"),
    })
    ResponseEntity<BbsShowVO> show(Long id);

    /**
     * 删除单个【帖子】
     */
    @ApiOperation(value="删除单个【帖子】")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", dataType = "Long", value = "【帖子】id", paramType = "path"),
    })
    ResponseEntity<Integer> delete(Long id);

    /**
     * 批量删除【帖子】
     */
    @ApiOperation(value = "批量删除【帖子】")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", dataType = "Long", value = "id数组", paramType = "body"),
    })
    ResponseEntity<Integer> deleteBatch(Long[] id);


}

